package datacrawl.test;


import java.sql.Connection;  
import java.sql.PreparedStatement;  
import java.sql.ResultSet;  
import java.sql.SQLException;  

//import com.bks.db.C3P0ConnentionProvider;  

public class Demo {  

  public static void main(String[] args) {  
      for(int i=0;i<30;i++){  
          new Thread(new Demo2()).start();  
      }  
  }  

}  

class Demo2 implements Runnable{  
    
  public void run(){  
      try {  
          Connection conn = C3P0ConnentionProvider.getConnection();  
          PreparedStatement pst = conn.prepareStatement("select * from gongyingshang_url1");  
          ResultSet rs = pst.executeQuery();  
          rs.next();  
          System.out.println(Thread.currentThread().getName()+":"+rs.getString(1));  
          try {  
              Thread.sleep(10*1000);  
          } catch (InterruptedException e) {  
              e.printStackTrace();  
          }  
            
      } catch (SQLException e) {  
          e.printStackTrace();  
      }  
  }  
}  